﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LCA.Community.Web.Filters;
using LCA.Community.DAL.Interfaces;
using Microsoft.Practices.Unity;
using LCA.Community.DAL.Model;

namespace LCA.Community.Web.Controllers
{
    /// <summary>
    /// Controller for managing home page.
    /// </summary>
    public class HomeController : BaseController
    {
        /// <summary>
        /// Action for the home page.
        /// </summary>
        /// <returns>View for the home page.</returns>
        public ActionResult Index()
        {
            ViewData["recentposts"] = PostRepository.RecentsPosts;
            ViewData["recentgroups"] = GroupsRepository.RecentGroups;
            ViewData["recentusers"] = UsersRepository.RecentUsers;
            ViewData["recentevents"] = EventsRepository.RecentEvents;

            return View("Index");
        } 

        [Dependency]
        public IPostsRepository PostRepository { get; set; }
        [Dependency]
        public IGroupsRepository GroupsRepository { get; set; }
        [Dependency]
        public IUsersRepository UsersRepository { get; set; }
        [Dependency]
        public IEventsRepository EventsRepository { get; set; } 
    }
}
